#pragma once

class CSprite
{
public:
	CSprite()
	{
	}
	void Load(const char* _fname)
	{
		m_tex.Load(_fname);
	}
	~CSprite()
	{
	}

	void Render(u32 x,u32 y)
	{
		glMatrixMode(GL_PROJECTION);
		glLoadIdentity();
		//glOrtho(-800/2, 800/2, -600/2, 600/2, -1, 1);
		glMatrixMode(GL_MODELVIEW);
		glLoadIdentity();

		glEnable(GL_TEXTURE_2D);

		//glPushMatrix();
		//glTranslatef(x, y, 0);

		m_tex.Bind(0);

		glBegin(GL_QUADS);

		glColor3f(1,1,1);
		
		glTexCoord2f(0,1); glVertex3f(-0.5,-0.5,0);
		glTexCoord2f(1,1); glVertex3f(0.5,-0.5,0);
		glTexCoord2f(1,0); glVertex3f(0.5,0.5,0);
		glTexCoord2f(0,0); glVertex3f(-0.5,0.5,0);
		
		glEnd();
		//glPopMatrix();
	}

private:
	CTexture m_tex;
};